import SvgIcon from "./SvgIcon/index.vue";

// 引入element-plus的图标
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

// 组件对象
const componentObj = {
  SvgIcon,
};

export default {
  install(app) {
    Object.keys(componentObj).forEach((key) => {
      // 注册为全局组件
      app.component(key, componentObj[key]);
    });

    // 将element-plus的图标全部注册为全局组件
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component);
    }
  },
};
